package everyday;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.IntStream;

/**
 * @Author: Siantar
 * @Date: 2023-08-16-17:55
 * @Description: 1.0
 */
public class T2682 {
    public int[] circularGameLosers(int n, int k) {
        int[] arr = IntStream.range(1, n + 1).toArray();
        for (int d = 0, p = 1; arr[d] != 0; arr[d] = 0, d = (d + p * k) % n, p++) ;
        return Arrays.stream(arr).filter(i -> i != 0).toArray();
    }
}
